home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 125 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: mail2news.demon.co.uk!sisyphus.demon.co.uk
  2. From: Dave.Sparks@sisyphus.demon.co.uk
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: Wed, 3 Jan 96 06:28:43 +0000 (GMT)
  6. Organization: to be supplied
  7. Message-ID: <19960103.583B18.6396@sisyphus.demon.co.uk>
  8. References: <4c64qj$c78@sinsen.sn.no> <4cb098$421@news.rwth-aachen.de>
  9. X-NNTP-Posting-Host: sisyphus.demon.co.uk
  10. In-reply-to: svent@informatik.rwth-aachen.de's message of 2 Jan 1996 10:09:44 GMT
  11. X-Attribution: DaveS
  12. Content-Length: 2152
  13. X-Lines: 53
  14. X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!sisyphus.demon.co.uk
  15.  
  16. >>>>> "ST" == Sven Thoennissen <svent@informatik.rwth-aachen.de> writes:
  17.  
  18. **>>>> can someone please tell me a sideffect example in asm ?
  19.   >>> How about move.l -(a0),-(a0) ?  Are you sure that a 68060 won't
  20.   >>> decrement the two registers in parallel?
  21.  
  22.   >> Even if it does, you could hardly blame the programmer for using it,
  23.   >> could you?
  24.  
  25.   ST> You are right, the programmer is not to blame. The 060 would be a
  26.   ST> _BAD_ processor if it did that way.
  27.  
  28. I took the request marked ** above to mean "can someone please give
  29. an example of a case where assembly code programmers rely on
  30. behaviour which is not defined?".  Saying "this obviously has the
  31. effect I expect" is not a proof that the behaviour is defined.
  32.  
  33. Let's break this instruction down into simpler steps:
  34.  
  35.   A   Move A0 to an arithmetic unit
  36.       Decrement the value (by 4 of course, not by 1)
  37.       Move the decremented value back to A0
  38.  
  39.   B   Move A0 to a data fetch unit
  40.       fetch the data from the address
  41.  
  42.   C   Move A0 to an arithmetic unit
  43.       Decrement the value
  44.       Move the decremented value back to A0
  45.  
  46.   D   Move A0 to a data store unit
  47.       store the previously fetched data to the address
  48.  
  49. The assembly code manual I have define that A is done before B,
  50. that C is done before D, and that B is done before D.  I have not
  51. found anything in the manual which assures me that B is done
  52. before C.  It's likely that a simple processor like the 68000
  53. performs the separate steps sequentially, in the order A B C D,
  54. but modern high-speed processors (RISC as well as CISC) achieve
  55. their high speeds by carrying out multiple steps in parallel,
  56. using multiple arithmetic units.  If the order of two steps is not
  57. constrained by the definition, those steps can be carried out in
  58. any order or concurrently.
  59.  
  60. The 68060 is only broken if it fails to do something which the
  61. definition says it must.  None of the assembly code programmers
  62. who are prepared to rely on B being done before C has cited a
  63. definition which says this must be so.
  64.  
  65. -- 
  66.         Dave.Sparks@sisyphus.demon.co.uk        (Staffordshire, England)
  67.  
  68.  ... details are more implementation-dependant than defined.
  69.  
  70.  
  71.